package net.dgg.rz.evaluating.entity.dto;


import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by zyou on 2019/5/24.
 */
public class SubjectOptionsDto {
    /**
     * 题目id
     */
    private Long subjectId;
    /**
     * 题目名字
     */
    private String subjectName;

    /**
     * 题目排序
     */
    private Integer subjectSort;

    /**
     * 题目类型（1、单选；2、多选）
     */
    private Integer subjectType;
    //关联选项
    private List<OptionsDto> optionsList;
    //关联选项
    private List<Long> optionsArr;

    public List<Long> getOptionsArr() {
        return optionsArr;
    }

    public void setOptionsArr(List<Long> optionsArr) {
        this.optionsArr = optionsArr;
    }

    public String getOptionsNames() {
        StringBuffer sb = new StringBuffer();
        if(this.optionsList != null){
            for (OptionsDto o:this.optionsList){
                String optionsName = o.getOptionsName();
                Integer subjectOptionsSort = o.getSubjectOptionsSort();
                sb.append(subjectOptionsSort);
                sb.append(".");
                sb.append(optionsName);
                sb.append("；");
            }
        }
        return sb.toString();
    }

    public String getOptionsIds() {
        StringBuffer sb = new StringBuffer();
        if(this.optionsList != null){
            int size = optionsList.size();
            int i = 0;
            for (OptionsDto o:this.optionsList){
                Long optionsId = o.getOptionsId();
                sb.append(optionsId);
                if(i<size-1){
                    sb.append(",");
                }
                i++;
            }
        }
        return sb.toString();
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public List<OptionsDto> getOptionsList() {
        return optionsList;
    }

    public void setOptionsList(List<OptionsDto> optionsList) {
        this.optionsList = optionsList;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public Integer getSubjectSort() {
        return subjectSort;
    }

    public void setSubjectSort(Integer subjectSort) {
        this.subjectSort = subjectSort;
    }

    public Integer getSubjectType() {
        return subjectType;
    }

    public void setSubjectType(Integer subjectType) {
        this.subjectType = subjectType;
    }
}
